<?php
defined('PHPFOX') or exit('NO DICE!');

class Hoidap_Component_Controller_All extends Phpfox_Component
{
	
	public function process()
	{		
		$this->template()->setTitle('Tất cả chủ đề');
		$category = Phpfox::getService('hoidap.category')->get('100');
		
		for($i=0; $i<count($category); $i++)
		{
			$idParentCat = $category[$i]['category_id'];
			$childCat = Phpfox::getService('hoidap.category')->getCatByParentCat($idParentCat);
				$category[$i]['childcat'] = $childCat;
		}
		/*
		echo '<pre>';
		print_r($category);
		echo '</pre>';
		*/
		$this->template()->assign('category', $category);  


	}
}

?>
